package com.orhon.smartcampus.modules.base.inputMapper;


import com.alibaba.fastjson.JSON;
import com.orhon.smartcampus.modules.base.gqlInputModel.GQLSubjectInput;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

import java.util.Map;

@Mapper
public interface SubjectInputMapper {

    SubjectInputMapper MAPPER = Mappers.getMapper(SubjectInputMapper.class);

    default GQLSubjectInput mapInput(final Map map){
        String json = JSON.toJSONString(map);
        GQLSubjectInput input = JSON.parseObject(json , GQLSubjectInput.class);
        return input;
    }
}
